﻿namespace HRM.CORE
{
    using DevExpress.Utils;
    using DevExpress.XtraBars;
    using DevExpress.XtraEditors;
    using DevExpress.XtraEditors.Controls;
    using DevExpress.XtraEditors.Repository;
    using DevExpress.XtraGrid.Columns;
    using DevExpress.XtraGrid.Views.Grid;
    using DevExpress.XtraTab;
    using HRM.CORE.Process;
    using System; using Extra.ERP;
    using System.ComponentModel;
    using System.Drawing;
    using System.Windows.Forms; using Common;

    public class xfmProcessList : XtraForm
    {
        private BarButtonItem barButtonItem2;
        private BarButtonItem barButtonItem3;
        private BarDockControl barDockControlBottom;
        private BarDockControl barDockControlLeft;
        private BarDockControl barDockControlRight;
        private BarDockControl barDockControlTop;
        private BarManager barManager1;
        private BarEditItem bbiBeginDate;
        private BarEditItem bbiEndDate;
        private BarEditItem bbiFilter;
        private BarEditItem bbiFilterBy;
        private BarButtonItem bbiView;
        private BarEditItem cboEmployeeName;
        private IContainer components = null;
        private GridColumn gridColumn1;
        private GridColumn gridColumn2;
        private GridColumn gridColumn3;
        private GridColumn gridColumn4;
        private GridColumn gridColumn5;
        private GridColumn gridColumn6;
        private GridColumn gridColumn7;
        public DevExpress.Utils.ImageCollection imageCollection2;
        private RepositoryItemDateEdit repBeginDate;
        private RepositoryItemGridLookUpEdit repEmployee;
        private RepositoryItemComboBox repEmployeeName;
        private RepositoryItemComboBox repFilter;
        private GridView repositoryItemGridLookUpEdit1View;
        private RepositoryItemDateEdit repToDate;
        private XtraTabPage tabAccident;
        private XtraTabPage tabAdvance;
        private XtraTabPage tabAssignment;
        private XtraTabPage tabBreakWork;
        private XtraTabPage tabConfirmTimeKeeper;
        private XtraTabPage tabDiscipline;
        private XtraTabPage tabPetition;
        private XtraTabPage tabPosition;
        private XtraTabPage tabRate;
        private XtraTabPage tabReward;
        private XtraTabPage tabSalary;
        private XtraTabPage tabTraining;
        private XtraTabControl xtraTabControl;
        private HRM.CORE.Process.xucListAccident xucListAccident;
        private HRM.CORE.Process.xucListAdvance xucListAdvance;
        private HRM.CORE.Process.xucListAssignment xucListAssignment;
        private HRM.CORE.Process.xucListBreakWork xucListBreakWork;
        private HRM.CORE.Process.xucListConfirmTimeKeeper xucListConfirmTimeKeeper;
        private HRM.CORE.Process.xucListDiscipline xucListDiscipline;
        private HRM.CORE.Process.xucListPetition xucListPetition;
        private HRM.CORE.Process.xucListPosition xucListPosition;
        private HRM.CORE.Process.xucListRate xucListRate;
        private HRM.CORE.Process.xucListReward xucListReward;
        private HRM.CORE.Process.xucListSalary xucListSalary;
        private HRM.CORE.Process.xucListTraining xucListTraining;

        public xfmProcessList()
        {
            this.InitializeComponent();
            this.Init();
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void Init()
        {
            if (this.xucListAssignment == null)
            {
                this.xucListAssignment = new HRM.CORE.Process.xucListAssignment();
                this.xucListAssignment.Dock = DockStyle.Fill;
                this.tabAssignment.Controls.Add(this.xucListAssignment);
            }
        }

        private void InitializeComponent()
        {
            this.components = new Container();
            ComponentResourceManager manager = new ComponentResourceManager(typeof(xfmProcessList));
            this.barManager1 = new BarManager(this.components);
            this.barDockControlTop = new BarDockControl();
            this.barDockControlBottom = new BarDockControl();
            this.barDockControlLeft = new BarDockControl();
            this.barDockControlRight = new BarDockControl();
            this.imageCollection2 = new DevExpress.Utils.ImageCollection(this.components);
            this.bbiFilterBy = new BarEditItem();
            this.repEmployee = new RepositoryItemGridLookUpEdit();
            this.repositoryItemGridLookUpEdit1View = new GridView();
            this.gridColumn5 = new GridColumn();
            this.gridColumn6 = new GridColumn();
            this.gridColumn7 = new GridColumn();
            this.bbiView = new BarButtonItem();
            this.cboEmployeeName = new BarEditItem();
            this.repEmployeeName = new RepositoryItemComboBox();
            this.bbiFilter = new BarEditItem();
            this.repFilter = new RepositoryItemComboBox();
            this.bbiBeginDate = new BarEditItem();
            this.repBeginDate = new RepositoryItemDateEdit();
            this.bbiEndDate = new BarEditItem();
            this.repToDate = new RepositoryItemDateEdit();
            this.barButtonItem2 = new BarButtonItem();
            this.barButtonItem3 = new BarButtonItem();
            this.xtraTabControl = new XtraTabControl();
            this.tabAssignment = new XtraTabPage();
            this.tabDiscipline = new XtraTabPage();
            this.tabReward = new XtraTabPage();
            this.tabTraining = new XtraTabPage();
            this.tabAdvance = new XtraTabPage();
            this.tabRate = new XtraTabPage();
            this.tabAccident = new XtraTabPage();
            this.tabPosition = new XtraTabPage();
            this.tabSalary = new XtraTabPage();
            this.tabPetition = new XtraTabPage();
            this.tabConfirmTimeKeeper = new XtraTabPage();
            this.tabBreakWork = new XtraTabPage();
            this.gridColumn1 = new GridColumn();
            this.gridColumn2 = new GridColumn();
            this.gridColumn3 = new GridColumn();
            this.gridColumn4 = new GridColumn();
            this.barManager1.BeginInit();
            this.imageCollection2.BeginInit();
            this.repEmployee.BeginInit();
            this.repositoryItemGridLookUpEdit1View.BeginInit();
            this.repEmployeeName.BeginInit();
            this.repFilter.BeginInit();
            this.repBeginDate.BeginInit();
            this.repBeginDate.VistaTimeProperties.BeginInit();
            this.repToDate.BeginInit();
            this.repToDate.VistaTimeProperties.BeginInit();
            this.xtraTabControl.BeginInit();
            this.xtraTabControl.SuspendLayout();
            base.SuspendLayout();
            this.barManager1.DockControls.Add(this.barDockControlTop);
            this.barManager1.DockControls.Add(this.barDockControlBottom);
            this.barManager1.DockControls.Add(this.barDockControlLeft);
            this.barManager1.DockControls.Add(this.barDockControlRight);
            this.barManager1.Form = this;
            this.barManager1.Images = this.imageCollection2;
            this.barManager1.Items.AddRange(new BarItem[] { this.bbiFilterBy, this.bbiView, this.cboEmployeeName, this.bbiFilter, this.bbiBeginDate, this.bbiEndDate, this.barButtonItem2, this.barButtonItem3 });
            this.barManager1.MaxItemId = 9;
            this.barManager1.RepositoryItems.AddRange(new RepositoryItem[] { this.repEmployee, this.repEmployeeName, this.repFilter, this.repBeginDate, this.repToDate });
            this.imageCollection2.ImageStream = (ImageCollectionStreamer) manager.GetObject("imageCollection2.ImageStream");
            this.imageCollection2.Images.SetKeyName(0x3d, "Vista (35).ico");
            this.imageCollection2.Images.SetKeyName(0x3e, "Security.ico");
            this.imageCollection2.Images.SetKeyName(0x3f, "RibbonPrintPreview_DocumentMapLarge.png");
            this.imageCollection2.Images.SetKeyName(0x40, "11.png");
            this.imageCollection2.Images.SetKeyName(0x41, "Sua.png");
            this.imageCollection2.Images.SetKeyName(0x42, "Them.png");
            this.imageCollection2.Images.SetKeyName(0x43, "PhanQuyen.png");
            this.imageCollection2.Images.SetKeyName(0x44, "11.png");
            this.imageCollection2.Images.SetKeyName(0x45, "plus.png");
            this.bbiFilterBy.Caption = "Lọc Theo Nh\x00e2n Vi\x00ean:";
            this.bbiFilterBy.Edit = this.repEmployee;
            this.bbiFilterBy.Id = 0;
            this.bbiFilterBy.Name = "bbiFilterBy";
            this.bbiFilterBy.Width = 100;
            this.repEmployee.Appearance.Font = new Font("Tahoma", 8.25f, FontStyle.Bold);
            this.repEmployee.Appearance.Options.UseFont = true;
            this.repEmployee.AutoHeight = false;
            this.repEmployee.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.repEmployee.Name = "repEmployee";
            this.repEmployee.NullText = "[Chọn nh\x00e2n vi\x00ean theo m\x00e3 số]";
            this.repEmployee.View = this.repositoryItemGridLookUpEdit1View;
            this.repositoryItemGridLookUpEdit1View.Columns.AddRange(new GridColumn[] { this.gridColumn5, this.gridColumn6, this.gridColumn7 });
            this.repositoryItemGridLookUpEdit1View.FocusRectStyle = DrawFocusRectStyle.RowFocus;
            this.repositoryItemGridLookUpEdit1View.Name = "repositoryItemGridLookUpEdit1View";
            this.repositoryItemGridLookUpEdit1View.OptionsSelection.EnableAppearanceFocusedCell = false;
            this.repositoryItemGridLookUpEdit1View.OptionsView.ShowAutoFilterRow = true;
            this.repositoryItemGridLookUpEdit1View.OptionsView.ShowGroupPanel = false;
            this.gridColumn5.Caption = "M\x00e3 nh\x00e2n vi\x00ean";
            this.gridColumn5.FieldName = "EmployeeCode";
            this.gridColumn5.Name = "gridColumn5";
            this.gridColumn5.Visible = true;
            this.gridColumn5.VisibleIndex = 0;
            this.gridColumn5.Width = 0x57;
            this.gridColumn6.Caption = "Họ l\x00f3t";
            this.gridColumn6.FieldName = "FirstName";
            this.gridColumn6.Name = "gridColumn6";
            this.gridColumn6.Visible = true;
            this.gridColumn6.VisibleIndex = 1;
            this.gridColumn6.Width = 130;
            this.gridColumn7.Caption = "T\x00ean";
            this.gridColumn7.FieldName = "LastName";
            this.gridColumn7.Name = "gridColumn7";
            this.gridColumn7.Visible = true;
            this.gridColumn7.VisibleIndex = 2;
            this.gridColumn7.Width = 80;
            this.bbiView.Caption = "Xem";
            this.bbiView.Id = 1;
            this.bbiView.ImageIndex = 3;
            this.bbiView.Name = "bbiView";
            this.cboEmployeeName.Appearance.Font = new Font("Tahoma", 8.25f, FontStyle.Bold);
            this.cboEmployeeName.Appearance.Options.UseFont = true;
            this.cboEmployeeName.Caption = "-";
            this.cboEmployeeName.Edit = this.repEmployeeName;
            this.cboEmployeeName.Id = 2;
            this.cboEmployeeName.Name = "cboEmployeeName";
            this.cboEmployeeName.Width = 150;
            this.repEmployeeName.Appearance.Font = new Font("Tahoma", 8.25f, FontStyle.Bold);
            this.repEmployeeName.Appearance.Options.UseFont = true;
            this.repEmployeeName.AutoHeight = false;
            this.repEmployeeName.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.repEmployeeName.Name = "repEmployeeName";
            this.repEmployeeName.NullText = "[T\x00ean Nh\x00e2n Vi\x00ean]";
            this.repEmployeeName.ReadOnly = true;
            this.bbiFilter.Caption = "Hiển Thị";
            this.bbiFilter.Edit = this.repFilter;
            this.bbiFilter.Id = 3;
            this.bbiFilter.Name = "bbiFilter";
            this.bbiFilter.Width = 120;
            this.repFilter.AutoHeight = false;
            this.repFilter.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.repFilter.Items.AddRange(new object[] { "<Tất Cả>", "<Theo Thời Gian>" });
            this.repFilter.Name = "repFilter";
            this.repFilter.TextEditStyle = TextEditStyles.DisableTextEditor;
            this.bbiBeginDate.Caption = "Từ Ng\x00e0y:";
            this.bbiBeginDate.Edit = this.repBeginDate;
            this.bbiBeginDate.Id = 4;
            this.bbiBeginDate.Name = "bbiBeginDate";
            this.bbiBeginDate.Visibility = BarItemVisibility.Never;
            this.bbiBeginDate.Width = 80;
            this.repBeginDate.AutoHeight = false;
            this.repBeginDate.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.repBeginDate.Name = "repBeginDate";
            this.repBeginDate.VistaTimeProperties.Buttons.AddRange(new EditorButton[] { new EditorButton() });
            this.bbiEndDate.Caption = "Đến Ng\x00e0y:";
            this.bbiEndDate.Edit = this.repToDate;
            this.bbiEndDate.Id = 5;
            this.bbiEndDate.Name = "bbiEndDate";
            this.bbiEndDate.Visibility = BarItemVisibility.Never;
            this.bbiEndDate.Width = 80;
            this.repToDate.AutoHeight = false;
            this.repToDate.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.repToDate.Name = "repToDate";
            this.repToDate.VistaTimeProperties.Buttons.AddRange(new EditorButton[] { new EditorButton() });
            this.barButtonItem2.Caption = "Đ\x00f3ng";
            this.barButtonItem2.Id = 7;
            this.barButtonItem2.Name = "barButtonItem2";
            this.barButtonItem3.Caption = "Đ\x00f3ng";
            this.barButtonItem3.Id = 8;
            this.barButtonItem3.ImageIndex = 0x16;
            this.barButtonItem3.Name = "barButtonItem3";
            this.xtraTabControl.BorderStyle = BorderStyles.NoBorder;
            this.xtraTabControl.BorderStylePage = BorderStyles.NoBorder;
            this.xtraTabControl.Dock = DockStyle.Fill;
            this.xtraTabControl.HeaderAutoFill = DefaultBoolean.False;
            this.xtraTabControl.HeaderButtons = TabButtons.Default | TabButtons.Next | TabButtons.Prev;
            this.xtraTabControl.HeaderLocation = TabHeaderLocation.Bottom;
            this.xtraTabControl.Location = new Point(0, 0);
            this.xtraTabControl.Name = "xtraTabControl";
            this.xtraTabControl.SelectedTabPage = this.tabAssignment;
            this.xtraTabControl.Size = new Size(0x424, 630);
            this.xtraTabControl.TabIndex = 4;
            this.xtraTabControl.TabPages.AddRange(new XtraTabPage[] { this.tabAssignment, this.tabDiscipline, this.tabReward, this.tabTraining, this.tabAdvance, this.tabRate, this.tabAccident, this.tabPosition, this.tabSalary, this.tabBreakWork, this.tabPetition, this.tabConfirmTimeKeeper });
            this.xtraTabControl.Selected += new TabPageEventHandler(this.xtraTabControl_Selected);
            this.tabAssignment.Name = "tabAssignment";
            this.tabAssignment.Size = new Size(0x41d, 0x259);
            this.tabAssignment.Text = "Đi C\x00f4ng T\x00e1c";
            this.tabDiscipline.Name = "tabDiscipline";
            this.tabDiscipline.Size = new Size(0x41d, 0x259);
            this.tabDiscipline.Text = "Kỷ Luật";
            this.tabReward.Name = "tabReward";
            this.tabReward.Size = new Size(0x41d, 0x259);
            this.tabReward.Text = "Khen Thưởng";
            this.tabTraining.Name = "tabTraining";
            this.tabTraining.Size = new Size(0x41d, 0x259);
            this.tabTraining.Text = "Qu\x00e1 Tr\x00ecnh Đ\x00e0o Tạo";
            this.tabAdvance.Name = "tabAdvance";
            this.tabAdvance.Size = new Size(0x41d, 0x259);
            this.tabAdvance.Text = "Tạm Ứng Lương";
            this.tabRate.Name = "tabRate";
            this.tabRate.Size = new Size(0x41d, 0x259);
            this.tabRate.Text = "Đ\x00e1nh Gi\x00e1";
            this.tabAccident.Name = "tabAccident";
            this.tabAccident.Size = new Size(0x41d, 0x259);
            this.tabAccident.Text = "Tai Nạn Lao Động";
            this.tabPosition.Name = "tabPosition";
            this.tabPosition.Size = new Size(0x41d, 0x259);
            this.tabPosition.Text = "Thay Đổi Chức Vụ";
            this.tabSalary.Name = "tabSalary";
            this.tabSalary.Size = new Size(0x41d, 0x259);
            this.tabSalary.Text = "Thay Đổi Lương";
            this.tabPetition.Name = "tabPetition";
            this.tabPetition.Size = new Size(0x41d, 0x259);
            this.tabPetition.Text = "Đơn Xin Nghỉ Ph\x00e9p";
            this.tabConfirmTimeKeeper.Name = "tabConfirmTimeKeeper";
            this.tabConfirmTimeKeeper.Size = new Size(0x41d, 0x259);
            this.tabConfirmTimeKeeper.Text = "X\x00e1c Nhận Giờ C\x00f4ng";
            this.tabBreakWork.Name = "tabBreakWork";
            this.tabBreakWork.Size = new Size(0x41d, 0x259);
            this.tabBreakWork.Text = "Ngưng Việc";
            this.gridColumn1.Caption = "M\x00e3 nh\x00e2n vi\x00ean";
            this.gridColumn1.FieldName = "EmployeeCode";
            this.gridColumn1.Name = "gridColumn1";
            this.gridColumn1.Visible = true;
            this.gridColumn1.VisibleIndex = 0;
            this.gridColumn2.Caption = "Họ l\x00f3t";
            this.gridColumn2.FieldName = "FirstName";
            this.gridColumn2.Name = "gridColumn2";
            this.gridColumn2.Visible = true;
            this.gridColumn2.VisibleIndex = 1;
            this.gridColumn3.Caption = "T\x00ean";
            this.gridColumn3.FieldName = "LastName";
            this.gridColumn3.Name = "gridColumn3";
            this.gridColumn3.Visible = true;
            this.gridColumn3.VisibleIndex = 2;
            this.gridColumn4.Caption = "Giới t\x00ednh";
            this.gridColumn4.FieldName = "Sex";
            this.gridColumn4.Name = "gridColumn4";
            this.gridColumn4.Visible = true;
            this.gridColumn4.VisibleIndex = 3;
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.AutoScaleMode = AutoScaleMode.Font;
            base.ClientSize = new Size(0x424, 630);
            base.Controls.Add(this.xtraTabControl);
            base.Controls.Add(this.barDockControlLeft);
            base.Controls.Add(this.barDockControlRight);
            base.Controls.Add(this.barDockControlBottom);
            base.Controls.Add(this.barDockControlTop);
            base.Name = "xfmProcessList";
            this.Text = "Qu\x00e1 Tr\x00ecnh L\x00e0m Việc | Theo Danh S\x00e1ch";
            this.barManager1.EndInit();
            this.imageCollection2.EndInit();
            this.repEmployee.EndInit();
            this.repositoryItemGridLookUpEdit1View.EndInit();
            this.repEmployeeName.EndInit();
            this.repFilter.EndInit();
            this.repBeginDate.VistaTimeProperties.EndInit();
            this.repBeginDate.EndInit();
            this.repToDate.VistaTimeProperties.EndInit();
            this.repToDate.EndInit();
            this.xtraTabControl.EndInit();
            this.xtraTabControl.ResumeLayout(false);
            base.ResumeLayout(false);
        }

        private void xtraTabControl_Selected(object sender, TabPageEventArgs e)
        {
            if (e.Page == this.tabAssignment)
            {
                if (this.xucListAssignment == null)
                {
                    this.xucListAssignment = new HRM.CORE.Process.xucListAssignment();
                    this.xucListAssignment.Dock = DockStyle.Fill;
                    this.tabAssignment.Controls.Add(this.xucListAssignment);
                }
            }
            else if (e.Page == this.tabAdvance)
            {
                if (this.xucListAdvance == null)
                {
                    this.xucListAdvance = new HRM.CORE.Process.xucListAdvance();
                    this.xucListAdvance.Dock = DockStyle.Fill;
                    this.tabAdvance.Controls.Add(this.xucListAdvance);
                }
            }
            else if (e.Page == this.tabRate)
            {
                if (this.xucListRate == null)
                {
                    this.xucListRate = new HRM.CORE.Process.xucListRate();
                    this.xucListRate.Dock = DockStyle.Fill;
                    this.tabRate.Controls.Add(this.xucListRate);
                }
            }
            else if (e.Page == this.tabTraining)
            {
                if (this.xucListTraining == null)
                {
                    this.xucListTraining = new HRM.CORE.Process.xucListTraining();
                    this.xucListTraining.Dock = DockStyle.Fill;
                    this.tabTraining.Controls.Add(this.xucListTraining);
                }
            }
            else if (e.Page == this.tabAccident)
            {
                if (this.xucListAccident == null)
                {
                    this.xucListAccident = new HRM.CORE.Process.xucListAccident();
                    this.xucListAccident.Dock = DockStyle.Fill;
                    this.tabAccident.Controls.Add(this.xucListAccident);
                }
            }
            else if (e.Page == this.tabDiscipline)
            {
                if (this.xucListDiscipline == null)
                {
                    this.xucListDiscipline = new HRM.CORE.Process.xucListDiscipline();
                    this.xucListDiscipline.Dock = DockStyle.Fill;
                    this.tabDiscipline.Controls.Add(this.xucListDiscipline);
                }
            }
            else if (e.Page == this.tabReward)
            {
                if (this.xucListReward == null)
                {
                    this.xucListReward = new HRM.CORE.Process.xucListReward();
                    this.xucListReward.Dock = DockStyle.Fill;
                    this.tabReward.Controls.Add(this.xucListReward);
                }
            }
            else if (e.Page == this.tabPosition)
            {
                if (this.xucListPosition == null)
                {
                    this.xucListPosition = new HRM.CORE.Process.xucListPosition();
                    this.xucListPosition.Dock = DockStyle.Fill;
                    this.tabPosition.Controls.Add(this.xucListPosition);
                }
            }
            else if (e.Page == this.tabSalary)
            {
                if (this.xucListSalary == null)
                {
                    this.xucListSalary = new HRM.CORE.Process.xucListSalary();
                    this.xucListSalary.Dock = DockStyle.Fill;
                    this.tabSalary.Controls.Add(this.xucListSalary);
                }
            }
            else if (e.Page == this.tabPetition)
            {
                if (this.xucListPetition == null)
                {
                    this.xucListPetition = new HRM.CORE.Process.xucListPetition();
                    this.xucListPetition.Dock = DockStyle.Fill;
                    this.tabPetition.Controls.Add(this.xucListPetition);
                }
            }
            else if (e.Page == this.tabConfirmTimeKeeper)
            {
                if (this.xucListConfirmTimeKeeper == null)
                {
                    this.xucListConfirmTimeKeeper = new HRM.CORE.Process.xucListConfirmTimeKeeper();
                    this.xucListConfirmTimeKeeper.Dock = DockStyle.Fill;
                    this.tabConfirmTimeKeeper.Controls.Add(this.xucListConfirmTimeKeeper);
                }
            }
            else if ((e.Page == this.tabBreakWork) && (this.xucListBreakWork == null))
            {
                this.xucListBreakWork = new HRM.CORE.Process.xucListBreakWork();
                this.xucListBreakWork.Dock = DockStyle.Fill;
                this.tabBreakWork.Controls.Add(this.xucListBreakWork);
            }
        }
    }
}

